package com.bosch.in.jfree.chart;

import java.util.List;

import org.jfree.data.statistics.BoxAndWhiskerItem;
import org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset;

public class BoxPlotChartDataSetCustomize extends DefaultBoxAndWhiskerCategoryDataset{
	/**
	 * 
	 */
	private static final long serialVersionUID = -382874089705959722L;

	/**
     * Adds a list of values relating to one box-and-whisker entity to the
     * table.  
     * The input list must be sorted in DESCENDING order
     * @param list  a collection of values from which the various medians will
     *              be calculated.
     * @param rowKey  the row key (<code>null</code> not permitted).
     * @param columnKey  the column key (<code>null</code> not permitted).
     *
     * @see #add(BoxAndWhiskerItem, Comparable, Comparable)
     */
	@Override
	public void add(List list, Comparable rowKey, Comparable columnKey) {
		Number q1 		= (Number) list.get(3);
		Number q3 		= (Number) list.get(1);
		Number min 		= (Number) list.get(4);
		Number max  	= (Number) list.get(0);
		Number median 	= (Number) list.get(2);
		Number totalItem= (Number) list.get(5);
		
        BoxAndWhiskerItem item = new BoxAndWhiskerItem(totalItem, median, q1, q3, min, max, min, max, null);
        add(item, rowKey, columnKey);
    }

}
